# 物料主档
from api_setting import *
from dim_api_auto_test.DimAPI.core.request_client import RestClient
from dim_api_auto_test.DimAPI.search import Search


class MaterialList(RestClient):
    def __init__(self, **kwargs):
        super(MaterialList, self).__init__(**kwargs)
        self.search = Search()

    def change_material_status(self, status, ids="35945"):
        """
        物料状态变更
        :return:
        """
        url = CHANGE_MATERIAL_STATUS_URL
        params = {
            "status": status,
            "reason": "测试物料状态变更",
            "ids": ids,
            "skipWarn": "true",
        }
        r = self.get(url=url, params=params)
        return r.content


if __name__ == "__main__":
    test = MaterialList()
    result = test.change_material_status("Freeze")
    print(result)
